
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Unicode-aware JS string splitting with full Emoji support.
Split a string into its constituent characters, without munging emoji and other non-BMP code points.
this is typescript version fork form runes
The native String#split
implementation does not pay attention to surrogate pairs. When the code units of a surrogate pair are split apart, they are not intelligible on their own. Unless they are put back together in the correct order, individual code units will cause problems in code that handles strings.
$ npm install runes2
const runes = require('runes2').default
const runes = require('runes2').runes
import runes from 'runes2';
import { runes } from 'runes2';
// Standard String.split
'♥️'.split('') // => ['♥', '️']
'Emoji 🤖'.split('') // => ['E', 'm', 'o', 'j', 'i', ' ', '�', '�']
'👩👩👧👦'.split('') // => ['�', '�', '', '�', '�', '', '�', '�', '', '�', '�']
// ES6 string iterator
[
...
'♥️'
] =>
['♥', '️']
[
...
'Emoji 🤖'
] // => [ 'E', 'm', 'o', 'j', 'i', ' ', '🤖' ]
[...'👩👩👧👦'] // => [ '👩', '', '👩', '', '👧', '', '👦' ]
// Runes
runes('♥️') // => ['♥️']
runes('Emoji 🤖') // => ['E', 'm', 'o', 'j', 'i', ' ', '🤖']
runes('👩👩👧👦') // => ['👩👩👧👦']
// String.substring
'👨👨👧👧a'.substring(1) // => '�👨👧👧a'
// Runes
runes.substr('👨👨👧👧a', 1) // => 'a'
FAQs
Unicode-aware JS string splitting, typescript version
The npm package runes2 receives a total of 117,130 weekly downloads. As such, runes2 popularity was classified as popular.
We found that runes2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.